/**
 * Copyright(c) kyle.
 */
package org.example.redis;

import io.lettuce.core.RedisClient;
import io.lettuce.core.RedisURI;

/**
 * 用来辅助操作Redis的类
 * <p>
 * 底层采用Lettuce：基于Netty框架的事件驱动的通信层，其方法调用是异步的。
 *
 * @author kyle
 * @version 1.00.00
 * @since [2020-10-28 09:13]
 * @updateUser [Kyle]
 * @updateRemark [说明本次修改内容]
 * @date [2020-10-28 09:13]
 */
public class RedisUtil {
    //定制的字符串URI语法：
    static RedisURI uri = RedisURI.create("redis://192.168.199.189:46379?timeout=60s");

    private static RedisClient intance = null;

    private RedisUtil() {
    }

    public static synchronized RedisClient getInstance() {
        if (intance == null) {
            intance = RedisClient.create(uri);
        }
        return intance;
    }
}
